/**
 * <copyright>
 * </copyright>
 *

 */
package br.pucrio.inf.tamdera.impl;

import br.pucrio.inf.tamdera.RegExpressionMapping;
import br.pucrio.inf.tamdera.TamderaPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Reg Expression Mapping</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.pucrio.inf.tamdera.impl.RegExpressionMappingImpl#getRegExpression <em>Reg Expression</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RegExpressionMappingImpl extends ConceptMapImpl implements RegExpressionMapping
{
  /**
   * The default value of the '{@link #getRegExpression() <em>Reg Expression</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getRegExpression()
   * @generated
   * @ordered
   */
  protected static final String REG_EXPRESSION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getRegExpression() <em>Reg Expression</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getRegExpression()
   * @generated
   * @ordered
   */
  protected String regExpression = REG_EXPRESSION_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected RegExpressionMappingImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return TamderaPackage.Literals.REG_EXPRESSION_MAPPING;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getRegExpression()
  {
    return regExpression;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setRegExpression(String newRegExpression)
  {
    String oldRegExpression = regExpression;
    regExpression = newRegExpression;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, TamderaPackage.REG_EXPRESSION_MAPPING__REG_EXPRESSION, oldRegExpression, regExpression));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case TamderaPackage.REG_EXPRESSION_MAPPING__REG_EXPRESSION:
        return getRegExpression();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case TamderaPackage.REG_EXPRESSION_MAPPING__REG_EXPRESSION:
        setRegExpression((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case TamderaPackage.REG_EXPRESSION_MAPPING__REG_EXPRESSION:
        setRegExpression(REG_EXPRESSION_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case TamderaPackage.REG_EXPRESSION_MAPPING__REG_EXPRESSION:
        return REG_EXPRESSION_EDEFAULT == null ? regExpression != null : !REG_EXPRESSION_EDEFAULT.equals(regExpression);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (regExpression: ");
    result.append(regExpression);
    result.append(')');
    return result.toString();
  }

} //RegExpressionMappingImpl
